﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using System.IO;
using System.Threading;

namespace TESTING_APP
{
    public partial class XtraForm1 : DevExpress.XtraEditors.XtraForm
    {
        public XtraForm1()
        {
            InitializeComponent();
        }

        private void XtraForm1_Load(object sender, EventArgs e)
        {
            // FileInfo fi = new FileInfo(@"Schlumberger\DataView\DataView.exe");
            FileInfo fi = new FileInfo(@"E:\Golden Software\Surfer 11\Surfer.exe");
            if (fi.Exists)
            {
                //string abc = @"C:\Schlumberger\DataView\Data\sample_time.las";
                string abc = @"D:\PRO-DOCS_12_25_2013\Contours.prn";


                //System.Diagnostics.Process prs = new System.Diagnostics.Process();
                //prs.Start(fi.FullName, abc);

                //Thread.Sleep(6000);

                System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo(fi.FullName);
                psi.RedirectStandardOutput = true;
                psi.Arguments = abc;
                // psi.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
                psi.UseShellExecute = false;
                System.Diagnostics.Process proc = System.Diagnostics.Process.Start(psi); ;
                //System.Diagnostics.Process proc = System.Diagnostics.Process.Start(psi); ;
                System.IO.StreamReader myOutput = proc.StandardOutput;
                //proc.WaitForExit(6000);
                if (!proc.HasExited)
                {
                    string output = myOutput.ReadToEnd();
                }
                //C:\Geoplus1\SegyView.exe
            }
        }
    }
}